local Class = require('lua.lang.Class')
local LuaValue = require('lua.vm.LuaValue')

--- @class LuaNil : LuaValue
local LuaNil = Class {
	__extends = LuaValue
}

--- @return LuaNil
function LuaNil:new()
	--- @type LuaNil
	local o = {}
	return setmetatable(o, LuaNil)
end

LuaNil._NIL = LuaNil:new()

--- @return boolean
function LuaNil:isNil()
	return true
end

--- @return number
function LuaNil:type()
	return self.TYPE_NIL
end

--- @return string
function LuaNil:typeName()
	return self.TYPE_NAMES[self:type() + 1]
end

--- @return string
function LuaNil:toLString()
	return 'nil'
end

--- @return boolean
function LuaNil:toBoolean()
	return false
end

return LuaNil